package cn.zhl.设计模式.命令;

/**
 * @program: demos
 * @description:
 * @author: 刘振华
 * @create: 2021-03-22 11:37
 **/
public class Client {
	public static void main(String[] args) {
		LightObject object = new LightObject();
		LightOnCommand lightOnCommand = new LightOnCommand(object);
		LightOffCommand lightOffCommand = new LightOffCommand(object);
		RemoteController controller = new RemoteController();
		controller.setCommond(0,lightOnCommand,lightOffCommand);

		System.out.println("----------开---------");
		controller.startButtonPushed(0);
		System.out.println("----------关---------");
		controller.offButtonPushed(0);
		System.out.println("----------撤销---------");
		controller.undoButtonPushed();
	}
}
